package Reservation;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class MysqlConnection {

	static Connection con;
	public static Connection getConnection() throws ClassNotFoundException{
		try{
		//Accessing driver from the JAR file
		Class.forName("com.mysql.jdbc.Driver");
		//Creating a variable for the connection called "con"
		//jdbc:mysql:..localhostL3306.cse305 --> This is the database
		con = DriverManager.getConnection("jdbc:mysql://mysql1.cs.stonybrook.edu:3306/fkou","fkou","106550498");
		if (!con.isClosed()){
			System.out.println("Connection established");
		}
		}
		catch(ClassNotFoundException e){
			System.out.println(e);
		} catch (SQLException e) {
			
			e.printStackTrace();
		}
		return con;
	}

}
